/**
 * Tax - calculates the tax based on locale. The tax calculation includes all 
 *       types of taxes for each locale.
 *       
 * CS575 Software Design
 * Group 6
 * Group Members: Anthony Davidson, Kendra Scheesley, Lyndsey Whitman, Stephen Zakrewsky
 * Date: May 31, 2012
 * Main Author(s): Lyndsey Whitman
 */
package edu.drexel.cs575.a3;

import java.util.List;

import edu.drexel.cs575.a3.location.Location;
import edu.drexel.cs575.a3.location.LocationProvider;
import edu.drexel.cs575.a3.tax.TaxRate;

public class Tax extends CalculateTax
{

	public Tax()
	{
		
	}
	
	@Override
	public double calculateTax(double price)
	{
		double tax = 0.0;
		Location location = LocationProvider.getInstance().getLocation();
		
		List<TaxRate> taxRates = location.getTaxRates();
		
		for(TaxRate tr : taxRates)
		{
			tax += price * tr.getValue();
		}
		
		return tax;
	}
}
